<?php
 class THeaders{
   var $PageTitle = '';
   var $PageKeywords;
   var $PageDescription;
   var $PageH1;
   var $PageLogoAlt;
   var $PageTextBlok1;
   var $PageFooter;


   function THeaders($page_id) {
		$settings = &getService('GlobalSettings');
		$link = mysql_connect($settings->get('db_host'), $settings->get('db_username'), $settings->get('db_password'));
		mysql_select_db($settings->get('db_name'), $link) or die(mysql_error());

	    $query = "select * from headers where p_id = \"" . $page_id . "\"";
    	$res = mysql_query($query) or die(mysql_error());

		while ($row=mysql_fetch_array($res)){
			$this->PageTitle = $row["p_title"];
			$this->PageKeywords = $row["p_keywords"];
			$this->PageDescription = $row["p_description"];
			$this->PageH1 = $row["p_h1"];
			$this->PageLogoAlt = $row["logo_alt"];
			$this->PageTextBlok1 = $row["text_blok1"];
			$this->PageFooter = $row["Footer"];
		}
		mysql_close($link);
   }


   function getPageTitle(){
   		if(isset($_REQUEST['settlement_region'])){
   			$cs = &getService('CitiesService');
   			$region = $cs->get($_REQUEST['settlement_region']);
   			$this->PageTitle .= isset($region) ? ' ' . $region->name : '';
   		}
   		return $this->PageTitle;
   }

    function getPageH1(){
   		if(isset($_REQUEST['settlement_region'])){
   			$cs = &getService('CitiesService');
   			$region = $cs->get($_REQUEST['settlement_region']);
   			$this->PageH1 .= isset($region) && isset($region->name) ? ' ' . $region->name : '';
   		}
   		return $this->PageH1;
   }


 }


?>